#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
  vector<bool> isArraySpecial(vector<int> &nums,
                              vector<vector<int>> &queries)
  {
    // 前缀和记录两数奇偶性是否相同
    int n = nums.size();
    vector<int> pre(n);
    pre[0] = 0;
    for (int i = 0; i < n - 1; i++)
      pre[i + 1] = pre[i] + (nums[i] % 2 == nums[i + 1] % 2);
    int m = queries.size();
    vector<bool> ans(m);
    // === push_back 50ms , 直接赋值1ms
    for (int i = 0; i < m; i++)
      ans[i] = (pre[queries[i][1]] == pre[queries[i][0]]);
    return ans;
  }
};
int main()
{
  Solution s;

  return 0;
}
